import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Microsoft
 * Date: 2022-11-15
 * Time: 9:56
 */
public class Test {
    public static void main(String[] args) {
        int[] arr1 = {1,2,3,4,5};
        arr1[0] = 9;
        int[] arr2 = arr1;
        arr2[0] = 10;
        System.out.println(Arrays.toString(arr1));
        System.out.println(Arrays.toString(arr2));
    }









    public static void main8(String[] args) {
        int[] arr = null;
        System.out.println(arr[0]);
    }


    public static void printArray7(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }
    }
    public static void main7(String[] args) {
        int[] arr = {1,2,3,4,5,6};
        printArray7(arr);
    }




    public static void main6(String[] args) {
        int[] arr = new int[100];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = i + 1;
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }
    }




    public static void hanoiTower1(int n ,char pos1,char pos2,char pos3) {
        if(n ==1) {
            move1(pos1,pos3);
            return;
        }
        hanoiTower1(n-1,pos1,pos3,pos2);
        move1(pos1,pos3);
        hanoiTower1(n-1,pos2,pos1,pos3);
    }
    public static void move1(char pos1, char pos2) {
        System.out.println(pos1 + "->" + pos2+" ");
    }

    public static void main5(String[] args) {
        hanoiTower1(3,'A','B','C');
    }






public static void main4(String[] args) {
    int[] arr = {4,3,2,1};
    System.out.println(arr);
}


    public static void main3(String[] args) {
        int[] arr = {1,2,3,4};
        String ret = Arrays.toString(arr);
        System.out.println(ret);
    }



    public static void main2(String[] args) {
        int[] array = {1,2,3,4,5,6};
        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i] + " ");
        }
        System.out.println();
        for (int x:array) {
            System.out.print(x + " ");
        }
    }


    public static void main1(String[] args) {
        int[] arr = {1,2,3};
        System.out.println(arr.length);
    }
}
